package cn.edu.zhku.citrusmonitor.util.xy;
import java.util.List;

@SuppressWarnings("hiding")
public class PageBean<Object> {

	private Integer currentPage = 1;//当前页数默认为1
	private Integer pageSize = 10;//每页显示的数据条数,默认为10
	private Long totalPage;//总页数
	private Long count;	//总记录数
	private List<Object> list;//每页显示的数据的集合
	
	public PageBean() { }
	
	public PageBean(Integer currentPage, Integer pageSize, Long totalRecord, List<Object> list) {
		super();
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.list = list;
	}
	
	
	
	public long getTotalPage() {
        long p = (count / pageSize);
        if (count % pageSize == 0)
            return p;
        else
            return p + 1;
    }

	public Integer getCurrentPage() {
		return currentPage;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public Long getCount() {
		return count;
	}

	public List<Object> getList() {
		return list;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}


	public void setTotalPage(Long totalPage) {
		this.totalPage = totalPage;
	}

	public void setCount(Long count) {
		this.count = count;
	}

	public void setList(List<Object> list) {
		this.list = list;
	}   
}
